
void main(){

  //bool
  var num = 0;
  assert(num == 0);

  //List
  var arr1 = ["Tom","Jetty","Sam","Cat"];
  var arr2 = List.of([1,2,3]);
  arr2.add(4);
  arr2.forEach((v) => print('${v}'));
  //List - 显式指定类型
  var arr3 = <String>["Tom","Jetty","Sam","Cat"];
  var arr4 = new List<int>.of([1,2,3]);
  print(arr4 is List<int>);

  //map
  var map1 = {"name": "Tom","sex": "boy"};
  var map2 = new Map();
  map2["name"] = "Tom";
  map2["sex"] = "male";
  map2.forEach((k,v) => print("${k} : ${v}"));
  //map - 显式指定类型
  var map3 = <String,String>{"name": "Tom","sex": "boy"};
  var map4 = new Map<String,String>();
  print(map4 is Map<String,String>);

  //const 与 final
  //const，表示变量在编译期间即能确定的值，必须直接赋一个字面量，而不能是一个变量或者公式
  //final 则可以在运行时确定值，如何赋值就无所谓了，但赋值后就不能再改了
  final name = "Andy";
  const count = 3;

  int x = 12;
  int y = 3;
  final z = x / y;

}